home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / HardwareContext-sun3.s,v < prev    next >
Text File  |  1989-06-21  |  4KB  |  234 lines

  1. head     3.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.3; strict;
  6. comment  @# @;
  7.  
  8.  
  9. 3.3
  10. date     89.06.21.10.14.25;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.2;
  13.  
  14. 3.2
  15. date     89.02.20.15.34.52;  author grunwald;  state Exp;
  16. branches ;
  17. next     3.1;
  18.  
  19. 3.1
  20. date     88.12.20.13.50.31;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.2;
  23.  
  24. 1.2
  25. date     88.10.30.13.03.41;  author grunwald;  state Exp;
  26. branches ;
  27. next     1.1;
  28.  
  29. 1.1
  30. date     88.09.18.16.42.32;  author grunwald;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @@
  37.  
  38.  
  39. 3.3
  40. log
  41. @*** empty log message ***
  42. @
  43. text
  44. @    .text
  45. REGMASK = 0x3ffe        | save d1-d7, a0-a5
  46. REGSAVE = 56            | # bytes needed to save registers
  47. REGOFFSET=56
  48.  
  49. |REGPUSHMASK = 0x7ffc        | save d1-d7, a0-a5
  50. |REGPULLMASK = 0x3ffe        | save d1-d7, a0-a5
  51. |REGSAVE = 56            | # bytes needed to save registers
  52. |REGOFFSET=56
  53.  
  54. FLOATMASK=0xff
  55. FLOATSAVE=96
  56. FLOATOFFSET= (REGOFFSET + FLOATSAVE)
  57.  
  58. TOTALSAVE=REGSAVE + FLOATSAVE
  59.  
  60. |
  61. |    Data offsets into HardwareContext
  62. |
  63. THREAD_FP    =  0
  64. THREAD_SP    =  4 + THREAD_FP
  65. THREAD_BASE    =  4 + THREAD_SP
  66. THREAD_END    =  4 + THREAD_BASE
  67. THREAD_MAX    =  4 + THREAD_END
  68.  
  69. |
  70. |    Stack offsets for arguments. The link is in 0, the return address
  71. |    is in 4.
  72. |
  73. CONTEXT_FROM    = 8
  74. CONTEXT_TO    = 12
  75.  
  76. |    CPU::switchTo(Thread*,Thread*)
  77. |
  78. | Transfer control from the active process to a new process.
  79. |
  80.     .text
  81. #ifdef    __Cplusplus__
  82.     .globl    __HardwareContext_magicSwitchTo
  83. __HardwareContext_magicSwitchTo:
  84. #endif
  85.  
  86. #ifdef    c_plusplus
  87.     .globl _magicSwitchTo__15HardwareContextFP15HardwareContext
  88. _magicSwitchTo__15HardwareContextFP15HardwareContext:
  89. #endif
  90.  
  91. #ifdef    __GNUG__
  92.     .globl _magicSwitchTo_PSHardwareContext_PSHardwareContext
  93.  _magicSwitchTo_PSHardwareContext_PSHardwareContext:
  94. #endif
  95.  
  96.     link    a6,#-TOTALSAVE            | reserve space on stack for saving reg
  97.     moveml    #REGMASK,a6@@(-REGOFFSET)    | save registers
  98.     fmovem    #FLOATMASK,a6@@(-FLOATOFFSET)| and floating point registers
  99.  
  100.     movl    a6@@(CONTEXT_FROM),a0    | a4 = address of current Thread object
  101.     movl    a6,a0@@(THREAD_FP)    | TheCpu.thisProcess -> savedFP
  102.     movl    a7,a0@@(THREAD_SP)
  103.  
  104.     movl    a6@@(CONTEXT_TO),a0    | a0 = address of dst Thread object
  105.     movl    a0@@(THREAD_FP),a6    | load FP of destination Thread Object
  106.     movl    a0@@(THREAD_SP),a7    | load SP of destination Thread
  107.  
  108.     fmovem    a6@@(-FLOATOFFSET),#FLOATMASK
  109.     moveml    a6@@(-REGOFFSET),#REGMASK    | restore registers
  110.     unlk    a6        | restore FP
  111.     rts
  112.  
  113. #ifdef    __Cplusplus__
  114.     .globl __HardwareContext_getSp
  115. __HardwareContext_getSp:
  116. #endif
  117.  
  118. #ifdef    c_plusplus
  119.     .globl _getSp__15HardwareContextFv
  120. _getSp__15HardwareContextFv:
  121. #endif
  122.  
  123. #ifdef    __GNUG__
  124.     .globl _getSp_PSHardwareContext
  125. _getSp_PSHardwareContext:
  126. #endif
  127.     movl    a7,d0
  128.     rts
  129. @
  130.  
  131.  
  132. 3.2
  133. log
  134. @Start using Gnu library heaps for schedulers
  135. @
  136. text
  137. @d3 2
  138. a4 2
  139. REGSAVE = 58            | # bytes needed to save registers
  140. REGOFFSET=58
  141. d6 5
  142. d12 1
  143. a12 1
  144. FLOATSAVE=64
  145. d53 1
  146. a53 2
  147.     link    a6,#-TOTALSAVE        | reserve space on stack for saving reg
  148.  
  149. @
  150.  
  151.  
  152. 3.1
  153. log
  154. @Steay version
  155. @
  156. text
  157. @d44 2
  158. a45 2
  159.     .globl    _switchTo_PSCpu_PSThread_PSThread
  160. _switchTo_PSCpu_PSThread_PSThread:
  161. d77 2
  162. a78 2
  163.     .globl _getSp_PSCpu
  164. _getSp_PSCpu:
  165. @
  166.  
  167.  
  168. 1.2
  169. log
  170. @*** empty log message ***
  171. @
  172. text
  173. @d7 1
  174. a7 1
  175. FLOATSAVE=128
  176. d37 4
  177. a40 3
  178. #ifdef    __Cplusplus2__
  179.     .globl _switchTo__3CpuFP6ThreadT1
  180. _switchTo__3CpuFP6ThreadT1:
  181. d42 1
  182. d47 1
  183. d70 4
  184. a73 3
  185. #ifdef    __Cplusplus2__
  186.     .globl _getSp__3CpuFv
  187. _getSp__3CpuFv:
  188. d75 1
  189. @
  190.  
  191.  
  192. 1.1
  193. log
  194. @Initial revision
  195. @
  196. text
  197. @d2 1
  198. a2 2
  199. |REGMASK = 0x3ffe        | save d1-d7, a0-a5
  200. REGMASK = 0x3fff
  201. d12 4
  202. a15 3
  203. THREAD_VTBL    = 0
  204. THREAD_DEBUG    =  4 + THREAD_VTBL
  205. THREAD_FP    =  4 + THREAD_DEBUG
  206. d21 6
  207. a26 3
  208. ARG_OBJ    = 8            | pointer to object instance
  209. ARG1    = 12            | first arg
  210. ARG2    = 16            | second arg
  211. d33 3
  212. a35 3
  213. #ifdef    __GCC__
  214.     .globl    __Cpu_switchToFPCThread__PCThread___
  215. __Cpu_switchToFPCThread__PCThread___:
  216. d37 1
  217. a37 1
  218. #ifdef    __NCC__
  219. d50 1
  220. a50 1
  221.     movl    a6@@(ARG2),a0        | a4 = address of current Thread object
  222. d54 1
  223. a54 1
  224.     movl    a6@@(ARG1),a0        | a0 = address of dst Thread object
  225. d63 3
  226. a65 3
  227. #ifdef    __GCC__
  228.     .globl    __Cpu_getSp
  229. __Cpu_getSp:
  230. d67 1
  231. a67 1
  232. #ifdef    __NCC__
  233. @
  234.